Conversation
hyesngy
approved these changes
May 22, 2025
Member
hyesngy
left a comment
There was a problem hiding this comment.
이번 주 워크북을 통해 React의 성능 최적화 기법인 debounce와 throttle을 적용해봤습니다! 쉽지 않은 개념이지만 모두 잘 해내셔서 대단합니다! 👏🏻👏🏻👏🏻
이런 최적화 기법들은 실제 서비스에서 UX를 크게 향상시키는 요소입니다. 앞으로 있을 데모데이 프로젝트에서도 꼭 활용해서 구현해보면 좋겠습니다!👍🏻👍🏻👍🏻
Comment on lines
+16
to
+25
| const searchLpsResult = useInfiniteSearchLps({ | ||
| searchType: "title", | ||
| keyword: debouncedKeyword, | ||
| order, | ||
| }); | ||
|
|
||
| const tagLpsResult = useInfiniteTagSearchLps({ | ||
| tagName: debouncedKeyword, | ||
| order, | ||
| }); |
Member
There was a problem hiding this comment.
현재 search.tsx에서 useInfiniteSearchLps와 useInfiniteTagSearchLps 두 개의 훅을 사용하고, 각각의 훅에서 거의 동일한 무한 스크롤 로직을 중복 구현하고 있습니다. useInfiniteSearchLps 내부에서 이미 searchType에 따라 다른 API를 호출하는 로직이 있음에도 불구하고, 태그 검색만을 위한 별도 훅을 또 만들어 사용하고 있는데, 이는 코드가 중복되고 유지보수성 측면에서 좋지 않습니다.
코드 일관성을 위해 하나의 훅으로 통합하여 관리하는 것이 좋을 것 같습니다!
Comment on lines
+112
to
+127
| <div className="flex justify-end w-full mb-4 pr-20"> | ||
| <div className="flex border rounded overflow-hidden"> | ||
| <button | ||
| onClick={() => handleOrderChange("asc")} | ||
| className={`w-24 px-4 py-1 text-sm ${order === "asc" ? "bg-black text-white" : "bg-white text-black"}`} | ||
| > | ||
| 오래된순 | ||
| </button> | ||
| <button | ||
| onClick={() => handleOrderChange("desc")} | ||
| className={`w-24 px-4 py-1 text-sm ${order === "desc" ? "bg-black text-white" : "bg-white text-black"}`} | ||
| > | ||
| 최신순 | ||
| </button> | ||
| </div> | ||
| </div> |
Member
There was a problem hiding this comment.
현재 search.tsx와 home.tsx에서 정렬 버튼 UI가 중복되고 있는데, 이 부분을 별도의 SortButton 컴포넌트로 분리하면 코드 중복을 줄이고 일관된 UI를 유지할 수 있을 것 같습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 미션 번호
8주차 Misson 1,2
📋 구현 사항
📎 스크린샷
✅ 체크리스트
🤔 질문 사항